<?php  

//vendor('fpdf/fpdf');
 App::import('Vendor', 'Fpdf', array('file' => 'fpdf/fpdf.php'));

 if (!defined('PARAGRAPH_STRING')) define('PARAGRAPH_STRING', '~~~');

 class pdfHelper extends FPDF {

 /**
 * Allows you to change the defaults set in the FPDF constructor
 *
 * @param string $orientation page orientation values: P, Portrait, L, or Landscape (default is P)
 * @param string $unit values: pt (point 1/72 of an inch), mm, cm, in. Default is mm
 * @param string $format values: A3, A4, A5, Letter, Legal or a two element array with the width and height in unit given in $unit
 */
 var $helpers= array();

    /** 
    * Allows you to change the defaults set in the FPDF constructor 
    * 
    * @param string $orientation page orientation values: P, Portrait, L, or Landscape    (default is P) 
    * @param string $unit values: pt (point 1/72 of an inch), mm, cm, in. Default is mm 
    * @param string $format values: A3, A4, A5, Letter, Legal or a two element array with the width and height in unit given in $unit 
    */ 
    function pdfHelper () {
		$orientation = 'P';
		$unit = 'mm';
		$format = 'A4';
		$this->FPDF($orientation, $unit, $format);
    }
	
	function beforeRender() {
	
	}
	function afterRender() {
	
	}
	function beforeLayout() {
	
	}
	function afterLayout() {
		
	}
     
	// Pied de page
	function Footer() {
		$this->SetY(-15);
		$this->SetFont('Arial','',9);
		// Numéro de page
		$this->Cell(0,5,'Page '.$this->PageNo().'/{nb}',0,1,'C');
		
		$this->SetFont('Arial','I',8);
		$this->Cell(0,3,utf8_decode("Voxity, SARL au capital de 45.000 euros - 514 008 929 RCS Grenoble - TVA intracommunautaire : FR48514008929"), 0, 1, 'C');
		$this->SetX(25.5);
		$this->Write(3,utf8_decode("85 Rue des Alliés, 38100 Grenoble - Tel: 04.816.801.10 - Fax: 04.816.801.14 - Web : "));
		$this->SetTextColor(0, 0, 238);
		$this->SetFont('Arial','IU',8);
		$this->Write(3, "www.voxity.fr", "http://www.voxity.fr");
		$this->SetTextColor(0);
		$this->SetFont('Arial','I',8);
		$this->Write(3, " - Mail : ");
		$this->SetTextColor(0, 0, 238);
		$this->SetFont('Arial','IU',8);
		$this->Write(3, "contact@voxity.fr", "mailto:contact@voxity.fr");
	}
    /** 
    * Allows you to control how the pdf is returned to the user, most of the time in CakePHP you probably want the string 
    * 
    * @param string $name name of the file. 
    * @param string $destination where to send the document values: I, D, F, S 
    * @return string if the $destination is S 
    */ 
    function fpdfOutput ($name = 'page.pdf', $destination = 'I') { 
        // I: send the file inline to the browser. The plug-in is used if available.  
        //    The name given by name is used when one selects the "Save as" option on the link generating the PDF. 
        // D: send to the browser and force a file download with the name given by name. 
        // F: save to a local file with the name given by name. 
        // S: return the document as a string. name is ignored. 
        return $this->Output($name, $destination);
    } 
} 
?>